<?php
/**
 * 程序入口类
 * ver 1.1
 * author Myxf
 */
require_once "phar://phpfun.phar/common.php";
require_once "phar://phpfun.phar/config.php";
class phpfun extends config
{  		
		//初始化
        function __construct()
        {	

        }

        /**
	    * Version 获取主程序版本以及更新升级
	    * @access public
	    * @param int $upgrade 是否升级 0不升级 1检查并升级
	    */
        public function Version($upgrade = 0){
        	set_time_limit(0);
        	$AppManager = new AppManager();
            return $AppManager->mVersion($this->config['SysConfig'],$upgrade);
        }

        //获取app信息
        public function App(){
        	$AppManager = new AppManager();
        	return $AppManager->mApp($this->config['SysConfig']);
        }

        /**
	    * AppInstall 安装app
	    * @access public
	    * @param string $appName app名称
	    */
        public function AppInstall($appName){
        	$AppManager = new AppManager();
        	return $AppManager->mAppInstall($this->config['SysConfig'],$appName);
        }

        /**
	    * AppInstall 卸载app
	    * @access public
	    * @param string $appName app名称
	    */
        public function AppDel($appName){
        	$AppManager = new AppManager();
        	return $AppManager->mAppDel($appName);
        }

        /**
	    * mClass 实例化Class类
	    * @access public
	    * @param string $ClassName 类名称
	    * @param array $args 参数 例子 array('test1','test2')
	    */
        public function mClass($ClassName, $args = null){
        	return AppManager::mClass($ClassName, $args);
        }
}